<template>
  <FormProvider :form="form">
    <Field
      name="price"
      title="价格"
      :component="[
        Switch,
        {
          openLabel: '开',
          closeLabel: '关',
          placeholder: '请输入',
          style: {
            width: 100,
          },
        },
      ]"
    />
  </FormProvider>
</template>

<script lang="ts">
import { createForm } from '@formily/core'
import { Switch } from '@formily/vxe-table/src/index'
import { FormProvider, FormConsumer, Field } from '@formily/vue'
import { defineComponent } from 'vue'

const form = createForm()

export default defineComponent({
  components: { FormProvider, FormConsumer, Field },
  setup() {
    return {
      form,
      Switch
    }

  }
})
</script>
